local zhaxiang = fk.CreateSkill {

  name = "joyex__zhaxiang",

  tags = { Skill.Compulsory, },

}



zhaxiang:addEffect(fk.AfterCardUseDeclared, {
  name = "joyex__zhaxiang",
  anim_type = "offensive",
  frequency = Skill.Compulsory,
  events = {fk.AfterCardUseDeclared},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(zhaxiang.name) and
      data.card.trueName == "slash" and data.card.color == Card.Red
  end,
  on_use = function(self, event, target, player, data)
    data.disresponsiveList = table.map(player.room.alive_players, Util.IdMapper)
  end,
})

zhaxiang:addEffect("targetmod", {
  name = "#joyex__zhaxiang_targetmod",
  residue_func = function(self, player, skill, scope)
    if skill.trueName == "slash_skill" and player:hasSkill(zhaxiang.name) then
      return 1
    end
    return 0
  end,
  bypass_distances = function(self, player, skill, card)
    return skill.trueName == "slash_skill" and card.color == Card.Red and player:hasSkill(zhaxiang.name)
  end,
})

return zhaxiang